package com.woniu.user.mapper;

import com.woniu.user.pojo.Praise;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.user.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 点赞表 Mapper 接口
 * </p>
 *
 * @author LiFangyu
 * @since 2023-02-15
 */
public interface PraiseMapper extends BaseMapper<Praise> {

    @Select("select * from t_user where phone = #{phone} and is_deleted = 0")
    User getUser(String phone);

    @Select("select * from t_praise where user_id = #{userId} and article_id = #{article} and is_deleted = 0")
    Praise selectIsPraise(@Param("userId") String userId,@Param("article") String article);
}
